package com.friddle.login.taobao.Simulate;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.http.Header;
import org.apache.http.cookie.Cookie;

import com.friddle.Download.PageGet.GetConfigure;
import com.friddle.Download.PageGet.PageGetter;
import com.friddle.Download.PageGet.PageResult;
import com.friddle.login.Login;

/**
 * Created by friddle on 15-1-31.
 */
public class LoginSimulate implements Login {

	public final String POST_LOGIN_URL = "https://unit.login.taobao.com/member/login.jhtml";
	public final String LOGIN_URL = "https://login.taobao.com";

	public Cookie setCookies() {
		return null;
	}

	public Map<String, String> getImportanInformation() {
		Map<String, String> values = new HashMap<String, String>();
		GetConfigure configure = new GetConfigure();
		PageResult result = PageGetter.getPageContent(LOGIN_URL, null);
		List<Header> headers = result.getHeaders();

		result.getHtmlContent();
		return null;
	}

	public List<Header> filterHeaders(String value, List<Header> headers) {
		List<Header> mHeader = new ArrayList<Header>();
		for (Header header : headers) {
			if (header.getName().equals(value)) {
				mHeader.add(header);
			}
		}
		return headers;
	}

	public static void main(String[] args) {
		LoginSimulate mSimulate = new LoginSimulate();
		mSimulate.getImportanInformation();
	}

	@Override
	public void setEnvironment(HashMap<String, String> env) {

	}

	@Override
	public Integer login(String user, String password) {
		return null;
	}

	@Override
	public GetConfigure getHttpCookie(GetConfigure configure) {
		return null;
	}
}
